#ifndef REGIONSEARCH_H
#define REGIONSEARCH_H

#include <QtGui>
#include <resultItem.h>
#include "global.h"

class QComboBox;
class QLabel;
class QGroupBox;
class QGridLayout;
class QVBoxLayout;
class QPushButton;

class RegionSearch : public QDialog
{
    Q_OBJECT

public:
    explicit RegionSearch(QWidget *parent = 0);

private slots:
    void updateResult();
    void pageSeqInc();
    void pageSeqDes();

private:
    int count;
    int numOfItem;
    int isEmpty;  //是否查找到结果
    int pageSeq;  //页的序号
    int maxPages;
    static const int numOfPerPage = 20;  //每页显示的数量

    QComboBox *area;
    QComboBox *ridgepole;
    QComboBox *layer;
    QComboBox *room;
    QComboBox *devName;

    QLabel *areaLabel;
    QLabel *ridgepoleLabel;
    QLabel *layerLabel;
    QLabel *roomLabel;
    QLabel *devNameLabel;
    QLabel *tmpLabel;

    QGroupBox *groupBox;

    QPushButton *pageUp;
    QPushButton *pageDown;

    QGridLayout *bottomLayout;
    QVBoxLayout *mainLayout;

    ResultItem *item[MAX_NUM_GRA_BTN];
};

#endif // REGIONSEARCH_H
